package com.xmut.mall.store.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmut.mall.store.entity.LogisticsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xmut.mall.store.searchparam.LogisticsSearchParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 1912120131suntingxing
 * @email 1192081604@qq.com
 * @date 2023-02-13 03:45:06
 */
@Mapper
public interface LogisticsDao extends BaseMapper<LogisticsEntity> {

    /**
     * 获取商家物流公司列表，如果已选择则checked有值
     *
     * @param storeId
     * @return
     */
    List<LogisticsEntity> getLogistics(@Param("storeId") Long storeId);

    /**
     * 官方管理平台获取物流公司分页数据
     *
     * @param initPage
     * @param param
     * @return
     */
    IPage<LogisticsEntity> getManagerLogisticsByPage(Page<Object> initPage, @Param("params") LogisticsSearchParam param);

    /**
     * 获取商家已选择物流公司列表
     *
     * @param storeId
     * @return
     */
    List<LogisticsEntity> getChecked(@Param("storeId") Long storeId);
}
